<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>crud配置项 | d2-crud-plus</title>
    <meta name="generator" content="VuePress 1.7.1">
    <link rel="icon" href="/d2-crud-plus/icon-only.png">
    <link rel="manifest" href="/d2-crud-plus/manifest.json">
    <link rel="apple-touch-icon" href="/d2-crud-plus/icons/apple-touch-icon-152x152.png">
    <link rel="mask-icon" href="/d2-crud-plus/icons/safari-pinned-tab.svg" color="#3eaf7c">
    <meta name="description" content="d2-crud-plus doc">
    <meta name="theme-color" content="#3eaf7c">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="msapplication-TileImage" content="/icons/msapplication-icon-144x144.png">
    <meta name="msapplication-TileColor" content="#000000">
    
    <link rel="preload" href="/d2-crud-plus/assets/css/0.styles.04fdeb33.css" as="style"><link rel="preload" href="/d2-crud-plus/assets/js/app.cf559687.js" as="script"><link rel="preload" href="/d2-crud-plus/assets/js/2.40e3d83c.js" as="script"><link rel="preload" href="/d2-crud-plus/assets/js/7.20165752.js" as="script"><link rel="preload" href="/d2-crud-plus/assets/js/91.60784f38.js" as="script"><link rel="prefetch" href="/d2-crud-plus/assets/js/10.df64ceb4.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/100.1b960036.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/101.0e6b7c65.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/102.60335619.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/11.d9cc7359.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/12.1fe853d9.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/13.beccd8a2.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/14.a22b7450.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/15.bfbc8e57.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/16.829da345.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/17.320c2a84.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/18.1ae2555c.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/19.dd1cfb7c.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/20.9f88070e.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/21.b4e311e8.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/22.508bfd88.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/23.d99910ba.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/24.3aac1d86.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/25.7f84d66c.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/26.010188d3.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/27.7ffcde1a.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/28.e5718534.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/29.a664aead.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/3.020e8c98.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/30.b5af54a5.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/31.3ce7cf81.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/32.74db3cbf.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/33.4afafef0.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/34.802ed380.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/35.829671b1.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/36.d62ff643.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/37.56355919.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/38.ef3567a6.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/39.f5bd440b.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/4.c9f444e5.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/40.097677b2.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/41.a1bdd4d7.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/42.d7c95839.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/43.ff1defe3.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/44.d08c49cd.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/45.15500c6e.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/46.49432e0a.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/47.4c86a170.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/48.9fb26f3b.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/49.2f1d3b4c.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/5.0c166f17.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/50.8adcf1fc.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/51.9debc188.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/52.b337fe05.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/53.1b4c4595.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/54.60ad5592.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/55.1ead7a60.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/56.4b4068b5.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/57.39b9a334.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/58.e342a69f.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/59.9286ee5c.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/6.dc3cf8b6.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/60.fca56e66.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/61.e53daf76.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/62.afa730c3.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/63.515344c7.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/64.5ea21d7e.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/65.5736928f.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/66.354c4f97.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/67.e458985d.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/68.9cf2e48e.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/69.afff9087.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/70.5f510366.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/71.08e285c9.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/72.fbdbf96d.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/73.4c7255c5.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/74.dbca5940.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/75.3cdd0828.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/76.cdad6b31.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/77.f79386ae.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/78.885784bf.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/79.90e30120.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/8.ce580690.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/80.2b6522e0.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/81.ab19ef97.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/82.cb46f8f4.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/83.67a48600.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/84.224a00c3.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/85.e4002b19.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/86.e1acfe7c.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/87.263718a8.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/88.4548fddc.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/89.dcd81e26.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/9.18394d2c.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/90.70193895.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/92.82037907.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/93.f7bbaf29.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/94.bfb96693.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/95.27670bd5.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/96.068d6ad1.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/97.d82da56e.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/98.20649291.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/99.74bab3f4.js">
    <link rel="stylesheet" href="/d2-crud-plus/assets/css/0.styles.04fdeb33.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/d2-crud-plus/" class="home-link router-link-active"><!----> <span class="site-name">d2-crud-plus</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/d2-crud-plus/guide/" class="nav-link router-link-active">
  指南
</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="更多" class="dropdown-title"><span class="title">更多</span> <span class="arrow down"></span></button> <button type="button" aria-label="更多" class="mobile-dropdown-title"><span class="title">更多</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><h4>
          核心
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/d2-crud-plus/d2-crud-x/" class="nav-link">
  D2-CRUD-X
</a></li></ul></li><li class="dropdown-item"><h4>
          周边项目
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="https://gitee.com/greper/d2-crud-plus" target="_blank" rel="noopener noreferrer" class="nav-link external">
  Gitee镜像
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-subitem"><a href="https://github.com/greper/d2-crud-plus-with-d2admin-starter" target="_blank" rel="noopener noreferrer" class="nav-link external">
  精简启动项目
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-subitem"><a href="https://gitee.com/greper/d2-crud-plus-with-d2admin-starter" target="_blank" rel="noopener noreferrer" class="nav-link external">
  精简启动项目[gitee]
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-subitem"><a href="https://github.com/greper/d2-crud-plus-with-d2admin-starter/tree/permission" target="_blank" rel="noopener noreferrer" class="nav-link external">
  精简启动项目-带权限
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-subitem"><a href="https://gitee.com/greper/d2-crud-plus-with-d2admin-starter/tree/permission" target="_blank" rel="noopener noreferrer" class="nav-link external">
  精简启动项目-带权限[gitee]
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-subitem"><a href="https://github.com/greper/d2-crud-plus-server" target="_blank" rel="noopener noreferrer" class="nav-link external">
  配套java后端
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-subitem"><a href="https://gitee.com/greper/d2-crud-plus-server" target="_blank" rel="noopener noreferrer" class="nav-link external">
  配套java后端[gitee]
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></li><li class="dropdown-item"><h4>
          附加
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/d2-crud-plus/guide/permission.html" class="nav-link">
  权限管理
</a></li><li class="dropdown-subitem"><a href="/d2-crud-plus/guide/generate.html" class="nav-link">
  代码生成
</a></li></ul></li><li class="dropdown-item"><h4>
          衍生项目
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="https://cloud.battcn.com/#/index" target="_blank" rel="noopener noreferrer" class="nav-link external">
  后台获取配置的CRUD
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></li><li class="dropdown-item"><h4>
          友情链接
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="https://gitee.com/docmirror/dev-sidecar" target="_blank" rel="noopener noreferrer" class="nav-link external">
  Github加速工具
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></li></ul></div></div><div class="nav-item"><a href="http://preview.d2-crud-plus.docmirror.cn/D2CrudPlusExample/index.html" target="_blank" rel="noopener noreferrer" class="nav-link external">
  演示
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <a href="https://github.com/greper/d2-crud-plus" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/d2-crud-plus/guide/" class="nav-link router-link-active">
  指南
</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="更多" class="dropdown-title"><span class="title">更多</span> <span class="arrow down"></span></button> <button type="button" aria-label="更多" class="mobile-dropdown-title"><span class="title">更多</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><h4>
          核心
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/d2-crud-plus/d2-crud-x/" class="nav-link">
  D2-CRUD-X
</a></li></ul></li><li class="dropdown-item"><h4>
          周边项目
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="https://gitee.com/greper/d2-crud-plus" target="_blank" rel="noopener noreferrer" class="nav-link external">
  Gitee镜像
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-subitem"><a href="https://github.com/greper/d2-crud-plus-with-d2admin-starter" target="_blank" rel="noopener noreferrer" class="nav-link external">
  精简启动项目
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-subitem"><a href="https://gitee.com/greper/d2-crud-plus-with-d2admin-starter" target="_blank" rel="noopener noreferrer" class="nav-link external">
  精简启动项目[gitee]
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-subitem"><a href="https://github.com/greper/d2-crud-plus-with-d2admin-starter/tree/permission" target="_blank" rel="noopener noreferrer" class="nav-link external">
  精简启动项目-带权限
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-subitem"><a href="https://gitee.com/greper/d2-crud-plus-with-d2admin-starter/tree/permission" target="_blank" rel="noopener noreferrer" class="nav-link external">
  精简启动项目-带权限[gitee]
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-subitem"><a href="https://github.com/greper/d2-crud-plus-server" target="_blank" rel="noopener noreferrer" class="nav-link external">
  配套java后端
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li><li class="dropdown-subitem"><a href="https://gitee.com/greper/d2-crud-plus-server" target="_blank" rel="noopener noreferrer" class="nav-link external">
  配套java后端[gitee]
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></li><li class="dropdown-item"><h4>
          附加
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/d2-crud-plus/guide/permission.html" class="nav-link">
  权限管理
</a></li><li class="dropdown-subitem"><a href="/d2-crud-plus/guide/generate.html" class="nav-link">
  代码生成
</a></li></ul></li><li class="dropdown-item"><h4>
          衍生项目
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="https://cloud.battcn.com/#/index" target="_blank" rel="noopener noreferrer" class="nav-link external">
  后台获取配置的CRUD
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></li><li class="dropdown-item"><h4>
          友情链接
        </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="https://gitee.com/docmirror/dev-sidecar" target="_blank" rel="noopener noreferrer" class="nav-link external">
  Github加速工具
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></li></ul></div></div><div class="nav-item"><a href="http://preview.d2-crud-plus.docmirror.cn/D2CrudPlusExample/index.html" target="_blank" rel="noopener noreferrer" class="nav-link external">
  演示
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <a href="https://github.com/greper/d2-crud-plus" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav> <div style="padding:20px 30px  0px 30px;"><a target="_blank" href="https://www.aliyun.com/minisite/goods?userCode=qya11txb" style="width:100%"><img src="https://img.alicdn.com/tfs/TB1qnR3R1L2gK0jSZFmXXc7iXXa-440-240.jpg" style="width:100%"></a></div> <ul class="sidebar-links"><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>指南</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/d2-crud-plus/guide/" aria-current="page" class="sidebar-link">介绍</a></li><li><a href="/d2-crud-plus/guide/quickstart.html" class="sidebar-link">快速上手</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>进阶</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/d2-crud-plus/guide/mixins.html" class="sidebar-link">核心逻辑</a></li><li><a href="/d2-crud-plus/guide/structure.html" class="sidebar-link">数据结构</a></li><li><a href="/d2-crud-plus/guide/column-type.html" class="sidebar-link">字段类型</a></li><li><a href="/d2-crud-plus/guide/types.html" class="sidebar-link">字段类型列表</a></li><li><a href="/d2-crud-plus/guide/custom-type.html" class="sidebar-link">自定义字段类型</a></li><li><a href="/d2-crud-plus/guide/component.html" class="sidebar-link">组件配置</a></li><li><a href="/d2-crud-plus/guide/slot.html" class="sidebar-link">slot自定义</a></li><li><a href="/d2-crud-plus/guide/extends.html" class="sidebar-link">自定义扩展</a></li><li><a href="/d2-crud-plus/guide/dict.html" class="sidebar-link">数据字典</a></li><li><a href="/d2-crud-plus/guide/nest-data.html" class="sidebar-link">多级数据</a></li><li><a href="/d2-crud-plus/guide/flat-data.html" class="sidebar-link">数据扁平化</a></li><li><a href="/d2-crud-plus/guide/data-export.html" class="sidebar-link">数据导出</a></li><li><a href="/d2-crud-plus/guide/line-edit.html" class="sidebar-link">行编辑</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading open"><span>API</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/d2-crud-plus/guide/options.html" aria-current="page" class="active sidebar-link">crud配置项</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/d2-crud-plus/guide/options.html#最简配置" class="sidebar-link">最简配置</a></li><li class="sidebar-sub-header"><a href="/d2-crud-plus/guide/options.html#配置与element-ui配置的对应关系" class="sidebar-link">配置与element-ui配置的对应关系</a></li><li class="sidebar-sub-header"><a href="/d2-crud-plus/guide/options.html#crudoptions" class="sidebar-link">crudOptions</a></li><li class="sidebar-sub-header"><a href="/d2-crud-plus/guide/options.html#columns" class="sidebar-link">columns</a></li><li class="sidebar-sub-header"><a href="/d2-crud-plus/guide/options.html#form" class="sidebar-link">form</a></li></ul></li><li><a href="/d2-crud-plus/guide/expose.html" class="sidebar-link">暴露的方法</a></li><li><section class="sidebar-group collapsable is-sub-group depth-1"><p class="sidebar-heading"><span>扩展</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable is-sub-group depth-1"><p class="sidebar-heading"><span>组件</span> <span class="arrow right"></span></p> <!----></section></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>附加功能</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/d2-crud-plus/guide/permission.html" class="sidebar-link">权限管理</a></li><li><a href="/d2-crud-plus/guide/generate.html" class="sidebar-link">代码生成</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>更多帮助</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/d2-crud-plus/guide/upgrade.html" class="sidebar-link">版本升级</a></li><li><a href="/d2-crud-plus/guide/breakingchange.html" class="sidebar-link">破坏性变更</a></li><li><a href="/d2-crud-plus/guide/upgradechange.html" class="sidebar-link">版本变更说明</a></li><li><a href="/d2-crud-plus/guide/questions.html" class="sidebar-link">常见问题</a></li><li><a href="/d2-crud-plus/guide/contact.html" class="sidebar-link">联系作者</a></li><li><a href="/d2-crud-plus/guide/donate.html" class="sidebar-link">捐赠</a></li><li><a href="/d2-crud-plus/guide/users.html" class="sidebar-link">他们在用</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>ChangeLog</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/d2-crud-plus/guide/changelogs/packages/d2-crud-x/CHANGELOG.html" class="sidebar-link">d2-crud-x</a></li><li><a href="/d2-crud-plus/guide/changelogs/packages/d2-crud-plus/CHANGELOG.html" class="sidebar-link">d2-crud-plus</a></li><li><a href="/d2-crud-plus/guide/changelogs/packages/d2-crud-plus-extends/CHANGELOG.html" class="sidebar-link">d2-crud-plus-extends</a></li><li><a href="/d2-crud-plus/guide/changelogs/packages/d2-crud-plus-example/CHANGELOG.html" class="sidebar-link">d2-crud-plus-example</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="crud配置项"><a href="#crud配置项" class="header-anchor">#</a> crud配置项</h1> <h2 id="最简配置"><a href="#最简配置" class="header-anchor">#</a> 最简配置</h2> <div class="language-javascript extra-class"><pre class="language-javascript"><code><span class="token keyword">export</span> <span class="token keyword">const</span> crudOptions <span class="token operator">=</span> <span class="token punctuation">{</span>
  columns<span class="token punctuation">:</span> <span class="token punctuation">[</span> <span class="token comment">//字段配置</span>
    <span class="token punctuation">{</span>
      title<span class="token punctuation">:</span> <span class="token string">'地区'</span><span class="token punctuation">,</span>  
      key<span class="token punctuation">:</span> <span class="token string">'province'</span><span class="token punctuation">,</span> 
      type<span class="token punctuation">:</span> <span class="token string">'select'</span><span class="token punctuation">,</span>
      dict<span class="token punctuation">:</span> <span class="token punctuation">{</span>url<span class="token punctuation">:</span><span class="token string">'/dict/getProvinceList'</span><span class="token punctuation">}</span>
    <span class="token punctuation">}</span>
  <span class="token punctuation">]</span>
<span class="token punctuation">}</span>
</code></pre></div><h2 id="配置与element-ui配置的对应关系"><a href="#配置与element-ui配置的对应关系" class="header-anchor">#</a> 配置与element-ui配置的对应关系</h2> <div class="language-js extra-class"><pre class="language-js"><code><span class="token keyword">export</span> <span class="token keyword">const</span> crudOptions <span class="token operator">=</span> <span class="token punctuation">{</span>
  columns<span class="token punctuation">:</span> <span class="token punctuation">[</span> 
    <span class="token punctuation">{</span>   <span class="token comment">//对应el-table-column的配置</span>
        form<span class="token punctuation">:</span><span class="token punctuation">{</span>
            itemProps<span class="token punctuation">:</span><span class="token punctuation">{</span><span class="token punctuation">}</span> <span class="token comment">//对应 el-form-item的配置</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>
  <span class="token punctuation">]</span><span class="token punctuation">,</span>
  options<span class="token punctuation">:</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token comment">//对应el-table的配置</span>
  formOptions<span class="token punctuation">:</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span>  <span class="token comment">//对应 el-dialog（el-drawer）、el-form  的配置</span>
  pagination<span class="token punctuation">:</span><span class="token punctuation">{</span><span class="token punctuation">}</span> <span class="token comment">// 对应el-pagination的配置</span>
<span class="token punctuation">}</span>
</code></pre></div><h2 id="crudoptions"><a href="#crudoptions" class="header-anchor">#</a> crudOptions</h2> <div class="language-javascript extra-class"><pre class="language-javascript"><code><span class="token keyword">export</span> <span class="token keyword">const</span> crudOptions <span class="token operator">=</span> <span class="token punctuation">{</span>
  columns<span class="token punctuation">:</span> <span class="token punctuation">[</span> 
    <span class="token comment">//字段配置</span>
    <span class="token comment">// 具体请参考下一节: 字段配置</span>
  <span class="token punctuation">]</span><span class="token punctuation">,</span>
  <span class="token comment">// 下方的配置都是可选的</span>
  viewOptions<span class="token punctuation">:</span><span class="token punctuation">{</span>
    disabled<span class="token punctuation">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// 开启view</span>
    componentType<span class="token punctuation">:</span> <span class="token string">'form'</span><span class="token punctuation">,</span> <span class="token comment">// 查看时使用哪种组件展示【form=使用表单组件,row=使用行展示组件】</span>
    <span class="token function-variable function">defaultRender</span><span class="token punctuation">:</span><span class="token punctuation">(</span><span class="token parameter">h<span class="token punctuation">,</span>scope</span><span class="token punctuation">)</span><span class="token operator">=&gt;</span><span class="token punctuation">{</span><span class="token keyword">return</span> <span class="token punctuation">(</span><span class="token operator">&lt;</span>span<span class="token operator">&gt;</span><span class="token punctuation">{</span>scope<span class="token punctuation">.</span>value<span class="token punctuation">}</span><span class="token operator">&lt;</span><span class="token operator">/</span>span<span class="token operator">&gt;</span><span class="token punctuation">)</span><span class="token punctuation">}</span> <span class="token comment">//没有配置组件的，默认渲染render</span>
  <span class="token punctuation">}</span><span class="token punctuation">,</span>
  pageOptions<span class="token punctuation">:</span><span class="token punctuation">{</span>
    <span class="token function-variable function">onInitAfter</span><span class="token punctuation">:</span> <span class="token keyword">function</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token comment">//初始化完成后触发，与覆盖this.initAfter()方法效果一样</span>
    compact<span class="token punctuation">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">//是否紧凑页面模式</span>
    <span class="token keyword">export</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
        local<span class="token punctuation">:</span><span class="token boolean">true</span><span class="token punctuation">,</span><span class="token comment">//本地导出，false为服务端导出</span>
        title<span class="token punctuation">:</span><span class="token string">'数据导出'</span><span class="token punctuation">,</span><span class="token comment">//导出的文件名</span>
        type<span class="token punctuation">:</span><span class="token string">'excel'</span><span class="token punctuation">,</span> <span class="token comment">//导出文件类型，可选： [ csv | excel ]</span>
        <span class="token function">formatter</span><span class="token punctuation">(</span><span class="token parameter">row<span class="token punctuation">,</span> context</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
            <span class="token comment">// 数据格式化，row.xxx = parseInt(row.xxx)</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token comment">// 以下是 vue-table-export 插件的参数</span>
        <span class="token comment">// excel</span>
        header<span class="token punctuation">:</span><span class="token string">''</span><span class="token punctuation">,</span><span class="token comment">// 第一行</span>
        merges<span class="token punctuation">:</span> <span class="token keyword">undefined</span><span class="token punctuation">,</span> <span class="token comment">// 合并单元格</span>
        <span class="token comment">// csv</span>
        noHeader<span class="token punctuation">:</span> <span class="token keyword">undefined</span><span class="token punctuation">,</span> <span class="token comment">// 不导出表头</span>
        separator<span class="token punctuation">:</span><span class="token string">','</span><span class="token punctuation">,</span> <span class="token comment">// 数据分隔符	非	String		,</span>
        quoted<span class="token punctuation">:</span><span class="token boolean">false</span>	<span class="token comment">//每项数据是否加引号</span>
    <span class="token punctuation">}</span>
  <span class="token punctuation">}</span><span class="token punctuation">,</span>
  formOptions<span class="token punctuation">:</span> <span class="token punctuation">{</span> 
    <span class="token comment">// 支持el-dialog的配置</span>
    <span class="token comment">// 支持el-form的配置</span>
    <span class="token comment">// 支持el-drawer的配置</span>
    type<span class="token punctuation">:</span><span class="token string">'dialog'</span><span class="token punctuation">,</span><span class="token comment">//默认对话框模式，drawer 抽屉模式</span>
    size<span class="token punctuation">:</span> <span class="token string">'50%'</span><span class="token punctuation">,</span> <span class="token comment">//抽屉模式的宽度</span>
    fullscreen<span class="token punctuation">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span><span class="token comment">//全屏按钮，传null则隐藏全屏按钮，抽屉模式请隐藏</span>
    draggable<span class="token punctuation">:</span><span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token comment">//是否支持表单对话框拖拽，抽屉模式请关闭</span>
    saveRemind<span class="token punctuation">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token comment">//有修改时是否需要保存提醒，也可以传入一个方法，自定义确认对话框，()=&gt; return vm.$confirm({})</span>
    labelWidth<span class="token punctuation">:</span> <span class="token string">'100px'</span><span class="token punctuation">,</span>
    labelPosition<span class="token punctuation">:</span> <span class="token string">'left'</span><span class="token punctuation">,</span>
    saveLoading<span class="token punctuation">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
    gutter<span class="token punctuation">:</span> <span class="token number">20</span><span class="token punctuation">,</span>
    maxHeight<span class="token punctuation">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token comment">// 对话框内部显示滚动条</span>
    defaultSpan<span class="token punctuation">:</span> <span class="token number">12</span><span class="token punctuation">,</span> <span class="token comment">// 默认表单字段所占宽度</span>
    updateTableDataAfterEdit<span class="token punctuation">:</span> <span class="token boolean">false</span> <span class="token comment">// 添加和删除提交后，是否直接更新本地table的数据，默认会自动刷新表格，所以不需要更新本地数据</span>
  <span class="token punctuation">}</span><span class="token punctuation">,</span>
  searchOptions<span class="token punctuation">:</span> <span class="token punctuation">{</span> <span class="token comment">//查询配置参数,</span>
    <span class="token comment">// 支持el-form的配置参数</span>
    form<span class="token punctuation">:</span><span class="token punctuation">{</span> <span class="token comment">//默认搜索参数</span>
      name<span class="token punctuation">:</span><span class="token string">'小明'</span> <span class="token comment">// 请求列表默认会带上此处配置参数,重置后会恢复成此处配置的值</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    size<span class="token punctuation">:</span><span class="token string">'small'</span><span class="token punctuation">,</span>
    show<span class="token punctuation">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span><span class="token comment">//是否显示搜索工具条</span>
    disabled<span class="token punctuation">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">//是否禁用搜索工具条</span>
    debounce<span class="token punctuation">:</span><span class="token punctuation">{</span> <span class="token comment">//自动查询防抖,debounce:false关闭自动查询</span>
      wait<span class="token punctuation">:</span> <span class="token number">500</span><span class="token punctuation">,</span> <span class="token comment">//延迟500毫秒</span>
      <span class="token operator">...</span> <span class="token comment">//options : https://www.lodashjs.com/docs/lodash.debounce</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    searchAfterReset<span class="token punctuation">:</span><span class="token boolean">true</span><span class="token punctuation">,</span><span class="token comment">//点击重置后是否立即查询</span>
    buttons<span class="token punctuation">:</span><span class="token punctuation">{</span>
      search<span class="token punctuation">:</span><span class="token punctuation">{</span> <span class="token comment">// 配置false，隐藏按钮</span>
        thin<span class="token punctuation">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">//瘦模式，thin=true 且 text=null 可以设置方形按钮节省位置 </span>
        text<span class="token punctuation">:</span> <span class="token string">'查看'</span><span class="token punctuation">,</span> <span class="token comment">//按钮文字， null= 取消文字，↓↓↓↓也可以传入一个方法↓↓↓↓</span>
        <span class="token comment">//text(scope){return 'xx'}</span>
        type<span class="token punctuation">:</span> <span class="token string">'warning'</span><span class="token punctuation">,</span> <span class="token comment">// 按钮类型</span>
        icon<span class="token punctuation">:</span><span class="token string">'el-view'</span><span class="token punctuation">,</span> <span class="token comment">//按钮图标，↓↓↓↓也可以传入一个方法↓↓↓↓</span>
         <span class="token comment">//icon(scope){return 'xx'}</span>
        size<span class="token punctuation">:</span> <span class="token string">'small'</span><span class="token punctuation">,</span> <span class="token comment">// 按钮大小</span>
        circle<span class="token punctuation">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span><span class="token comment">//圆形按钮 ，需要thin=true,且text=null</span>
        show<span class="token punctuation">:</span><span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token comment">// 是否显示按钮，↓↓↓↓也可以传入一个方法根据数据决定该按钮是否显示↓↓↓↓↓↓↓↓</span>
        <span class="token comment">//show(index,row){return row.status==='xxx'} </span>
        disabled<span class="token punctuation">:</span><span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// 是否禁用，↓↓↓↓也可以传入一个方法根据数据决定该按钮是否禁用↓↓↓↓</span>
        <span class="token comment">//disabled(index,row){return row.status==='xxx'} </span>
        order<span class="token punctuation">:</span> <span class="token number">1</span> <span class="token comment">//排序号，数字小，排前面</span>
      <span class="token punctuation">}</span><span class="token punctuation">,</span> 
      reset<span class="token punctuation">:</span><span class="token punctuation">{</span><span class="token punctuation">}</span> <span class="token comment">//同上</span>
    <span class="token punctuation">}</span>    
  <span class="token punctuation">}</span><span class="token punctuation">,</span>
  options<span class="token punctuation">:</span> <span class="token punctuation">{</span> <span class="token comment">// d2-crud</span>
    <span class="token comment">// 支持el-table的配置参数</span>
    hide<span class="token punctuation">:</span><span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">//隐藏表格， 配合 body插槽，可以实现酒店dashboard示例的效果</span>
    stripe<span class="token punctuation">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    border<span class="token punctuation">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
    highlightCurrentRow<span class="token punctuation">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">//是否高亮选中行</span>
    size<span class="token punctuation">:</span> <span class="token string">'mini'</span><span class="token punctuation">,</span>
    <span class="token comment">//要想去掉el-table自身的滚动条，内容高度撑开</span>
    <span class="token comment">//可以配置 height:null,maxHeight:null,然后用空方法覆盖reComputeCrudHeight(){}</span>
    height<span class="token punctuation">:</span> <span class="token string">'100%'</span><span class="token punctuation">,</span> 
    maxHeight<span class="token punctuation">:</span> <span class="token string">'auto'</span><span class="token punctuation">,</span>
    events<span class="token punctuation">:</span><span class="token punctuation">{</span> <span class="token comment">//el-table事件监听</span>
      <span class="token string">'expand-change'</span><span class="token punctuation">:</span><span class="token punctuation">(</span><span class="token parameter">event</span><span class="token punctuation">)</span><span class="token operator">=&gt;</span><span class="token punctuation">{</span><span class="token punctuation">}</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token function">fetchDetail</span><span class="token punctuation">(</span><span class="token parameter">index<span class="token punctuation">,</span>row<span class="token punctuation">,</span>mode</span><span class="token punctuation">)</span><span class="token punctuation">{</span><span class="token keyword">return</span> row<span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token comment">// 打开对话框前调用，获取form详情数据</span>
  <span class="token punctuation">}</span><span class="token punctuation">,</span>
  pagination<span class="token punctuation">:</span> <span class="token punctuation">{</span> <span class="token comment">//翻页配置</span>
    <span class="token comment">// 支持el-pagination</span>
    currentPage<span class="token punctuation">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
    pageSize<span class="token punctuation">:</span> <span class="token number">20</span><span class="token punctuation">,</span>
    total<span class="token punctuation">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
    storage<span class="token punctuation">:</span><span class="token boolean">true</span> <span class="token comment">//本地保存用户每页条数修改，刷新不会丢失该修改，false=关闭</span>
    <span class="token comment">// storage:'keysuffix'// 传入字符串，将会给保存的key增加一个后缀，用于区分同一个页面下多个crud</span>
  <span class="token punctuation">}</span><span class="token punctuation">,</span>
  indexRow<span class="token punctuation">:</span> <span class="token punctuation">{</span> <span class="token comment">// 序号列,或者直接传true,不显示title，不居中</span>
    title<span class="token punctuation">:</span> <span class="token string">'序号'</span><span class="token punctuation">,</span>
    align<span class="token punctuation">:</span> <span class="token string">'center'</span><span class="token punctuation">,</span>
    width<span class="token punctuation">:</span> <span class="token number">100</span>
  <span class="token punctuation">}</span><span class="token punctuation">,</span>
  selectionRow<span class="token punctuation">:</span> <span class="token punctuation">{</span>  <span class="token comment">//选择列</span>
    align<span class="token punctuation">:</span> <span class="token string">'center'</span><span class="token punctuation">,</span>
    width<span class="token punctuation">:</span> <span class="token number">100</span>
  <span class="token punctuation">}</span><span class="token punctuation">,</span>
  expandRow<span class="token punctuation">:</span> <span class="token punctuation">{</span> <span class="token comment">// 展开列， 或者直接传true,不显示title，不居中</span>
    title<span class="token punctuation">:</span> <span class="token string">'展开'</span><span class="token punctuation">,</span>
    align<span class="token punctuation">:</span> <span class="token string">'center'</span><span class="token punctuation">,</span>
    width<span class="token punctuation">:</span> <span class="token number">100</span>
  <span class="token punctuation">}</span><span class="token punctuation">,</span>     
  rowHandle<span class="token punctuation">:</span> <span class="token punctuation">{</span> 
    <span class="token comment">//行操作栏，与d2-crud一致，默认配置有修改与删除</span>
    width<span class="token punctuation">:</span> <span class="token number">100</span><span class="token punctuation">,</span> <span class="token comment">// 操作列宽度</span>
    title<span class="token punctuation">:</span> <span class="token string">'操作'</span><span class="token punctuation">,</span><span class="token comment">// 操作列名</span>
    view<span class="token punctuation">:</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token comment">//查看按钮，配置请参考上方searchOptions.buttons</span>
    edit<span class="token punctuation">:</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token comment">//编辑按钮,配置同上</span>
    remove<span class="token punctuation">:</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token comment">//删除按钮,配置同上</span>
    custom<span class="token punctuation">:</span><span class="token punctuation">[</span><span class="token comment">//自定义按钮</span>
      <span class="token punctuation">{</span>
         <span class="token comment">//配置同上</span>
         <span class="token comment">//点击事件,需要在&lt;d2-crud-x @custom-emit=&quot;yourHandle&quot;/&gt;</span>
         emit<span class="token punctuation">:</span> <span class="token string">'custom-emit'</span> 
      <span class="token punctuation">}</span>
    <span class="token punctuation">]</span><span class="token punctuation">,</span>
    dropdown<span class="token punctuation">:</span> <span class="token punctuation">{</span> <span class="token comment">//配置false关闭dropdown</span>
      <span class="token comment">// atLeast 至少几个以上按钮才收入下拉框中，配置0全部按钮收入下拉框</span>
      <span class="token comment">// 注意show=false的按钮也会计算在内（行编辑按钮默认是隐藏的也会占一个位置，虽然它没有显示）</span>
      atLeast<span class="token punctuation">:</span> <span class="token number">2</span><span class="token punctuation">,</span> 
      text<span class="token punctuation">:</span> <span class="token string">'更多'</span> <span class="token comment">// 按钮文字</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span> 
  <span class="token punctuation">}</span><span class="token punctuation">,</span>
  formGroup<span class="token punctuation">:</span> <span class="token punctuation">{</span>  <span class="token comment">//表单分组</span>
    type<span class="token punctuation">:</span> <span class="token string">'collapse'</span><span class="token punctuation">,</span> <span class="token comment">// tab暂未实现</span>
    accordion<span class="token punctuation">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
    groups<span class="token punctuation">:</span> <span class="token punctuation">{</span> <span class="token comment">//分组</span>
      base<span class="token punctuation">:</span> <span class="token punctuation">{</span> <span class="token comment">//分组key</span>
        title<span class="token punctuation">:</span> <span class="token string">'商品基础'</span><span class="token punctuation">,</span> <span class="token comment">//分组标题</span>
        disabled<span class="token punctuation">:</span><span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">//禁止展开或收起</span>
        <span class="token comment">// disabled(context){return true} //可以传一个方法</span>
        show<span class="token punctuation">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span><span class="token comment">//是否显示</span>
        <span class="token comment">// show(context){return true} //可以传一个方法</span>
        icon<span class="token punctuation">:</span> <span class="token string">'el-icon-goods'</span><span class="token punctuation">,</span> <span class="token comment">//分组标题前的图标</span>
        columns<span class="token punctuation">:</span> <span class="token punctuation">[</span><span class="token string">'title'</span><span class="token punctuation">,</span> <span class="token string">'code'</span><span class="token punctuation">,</span> <span class="token string">'images'</span><span class="token punctuation">]</span> <span class="token comment">//该组内包含的字段列表</span>
      <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>
  <span class="token punctuation">}</span><span class="token punctuation">,</span>
  format<span class="token punctuation">:</span> <span class="token punctuation">{</span>
    <span class="token function">response</span> <span class="token punctuation">(</span><span class="token parameter">ret</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token keyword">return</span> ret<span class="token punctuation">.</span>data <span class="token comment">//getlist返回结果获取</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    page<span class="token punctuation">:</span> <span class="token punctuation">{</span> <span class="token comment">// page接口返回的数据结构配置，</span>
      request<span class="token punctuation">:</span> <span class="token punctuation">{</span> <span class="token comment">// 请求参数</span>
        current<span class="token punctuation">:</span> <span class="token string">'current'</span><span class="token punctuation">,</span> <span class="token comment">//当前页码</span>
        size<span class="token punctuation">:</span> <span class="token string">'size'</span> <span class="token comment">//当前每页条数</span>
        <span class="token comment">// size(page,size){page[xxx]=size}//你还可以配置为一个方法，自定义操作请求参数</span>
      <span class="token punctuation">}</span><span class="token punctuation">,</span>
      response<span class="token punctuation">:</span> <span class="token punctuation">{</span> <span class="token comment">//返回结果</span>
        current<span class="token punctuation">:</span> <span class="token string">'current'</span><span class="token punctuation">,</span> <span class="token comment">// 当前页码 ret.data.current</span>
        size<span class="token punctuation">:</span> <span class="token string">'size'</span><span class="token punctuation">,</span> <span class="token comment">// 每页条数，ret.data.size, </span>
        <span class="token comment">//size: (data) =&gt; { return data.size }, //你也可以配置一个方法，自定义返回</span>
        total<span class="token punctuation">:</span> <span class="token string">'total'</span><span class="token punctuation">,</span> <span class="token comment">// 总记录数 ret.data.total</span>
        records<span class="token punctuation">:</span> <span class="token string">'records'</span> <span class="token comment">// 列表数组 ret.data.records</span>
      <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>
  <span class="token punctuation">}</span><span class="token punctuation">,</span>
  addTemplate<span class="token punctuation">:</span> <span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token comment">//根据form配置自动生成,请不要配置</span>
  editTemplate<span class="token punctuation">:</span> <span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token comment">//根据form配置自动生成,请不要配置</span>
  addRules<span class="token punctuation">:</span> <span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token comment">//根据form配置自动生成,请不要配置</span>
  editRules<span class="token punctuation">:</span> <span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token comment">//根据form配置自动生成,请不要配置</span>
  list<span class="token punctuation">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token comment">//数据列表，跟pageRequest从后端获取数据</span>
  loading<span class="token punctuation">:</span> <span class="token boolean">false</span> <span class="token comment">//当前是否正在loading,请不要配置</span>
<span class="token punctuation">}</span>

</code></pre></div><h2 id="columns"><a href="#columns" class="header-anchor">#</a> columns</h2> <div class="language-js extra-class"><pre class="language-js"><code>crudOptions<span class="token operator">=</span><span class="token punctuation">{</span>
    columns<span class="token punctuation">:</span><span class="token punctuation">[</span>
    <span class="token punctuation">{</span>
          title<span class="token punctuation">:</span> <span class="token string">'地区'</span><span class="token punctuation">,</span>  
          key<span class="token punctuation">:</span> <span class="token string">'province'</span><span class="token punctuation">,</span> 
          <span class="token comment">// -----下方的配置都是可选的------</span>
          type<span class="token punctuation">:</span> <span class="token string">'select'</span><span class="token punctuation">,</span> <span class="token comment">//字段类型，根据类型可生成该字段的默认配置，下方那么多配置基本可以不用写（没有定制化需求的话）</span>
          sortable<span class="token punctuation">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token comment">//是否支持排序，如果传入'custom'，则为服务端排序。如果传入其他字符串，则以该字符串作为排序字段名</span>
          search<span class="token punctuation">:</span> <span class="token punctuation">{</span>
                disabled<span class="token punctuation">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">//是否禁用该字段的查询，默认false</span>
                component<span class="token punctuation">:</span><span class="token punctuation">{</span> <span class="token comment">//查询框组件配置，默认根据form配置生成 </span>
                   name<span class="token punctuation">:</span><span class="token string">'dict-select'</span> <span class="token comment">//支持任何v-model组件</span>
                <span class="token punctuation">}</span><span class="token punctuation">,</span>
                order<span class="token punctuation">:</span> <span class="token number">10</span><span class="token punctuation">,</span> <span class="token comment">//查询字段排序，数字越小越靠前</span>
                <span class="token comment">// 是否启用搜索框的slot插槽,需要d2-crud-x才支持</span>
                <span class="token comment">// 示例 http://preview.d2-crud-plus.docmirror.cn/D2CrudPlusExample/#/demo/form/slot</span>
                slot<span class="token punctuation">:</span><span class="token boolean">false</span> 
          <span class="token punctuation">}</span><span class="token punctuation">,</span>
          form<span class="token punctuation">:</span> <span class="token punctuation">{</span> 
            <span class="token comment">//添加和编辑表单配置</span>
            <span class="token comment">// 具体请参考下一节: form配置</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span>
          addForm<span class="token punctuation">:</span><span class="token punctuation">{</span>
             <span class="token comment">//添加对话框的特别配置，当添加和修改的配置有差异时，可以在此单独配置差异部分</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span>
          editForm<span class="token punctuation">:</span><span class="token punctuation">{</span>
             <span class="token comment">//修改对话框的特别配置，当添加和修改的配置有差异时，可以在此单独配置差异部分</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span>
          view<span class="token punctuation">:</span><span class="token punctuation">{</span><span class="token comment">// 查看对话框组件的单独配置</span>
            disabled<span class="token punctuation">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
            component<span class="token punctuation">:</span><span class="token punctuation">{</span><span class="token operator">...</span><span class="token punctuation">}</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span> 
          <span class="token function">valueBuilder</span> <span class="token punctuation">(</span><span class="token parameter">row<span class="token punctuation">,</span>key</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            <span class="token comment">// 某些组件传入的value值可能是一个复杂对象，而row中的单个属性的值不合适传入</span>
            <span class="token comment">// 则需要在打开编辑对话框前将row里面多个字段组合成组件需要的value对象</span>
            <span class="token comment">// 例如：国际手机号(mobileValue为此column的key) </span>
            <span class="token comment">// 示例 http://preview.d2-crud-plus.docmirror.cn/D2CrudPlusExample/#/demo/form/phone</span>
            <span class="token comment">// row.mobileValue = { phoneNumber: row.phone, callingCode: row.code, countryCode: row.country }</span>
            <span class="token comment">// valueBuilder将会在pageRequest成功返回数据后执行</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span>
          <span class="token function">valueResolve</span> <span class="token punctuation">(</span><span class="token parameter">row<span class="token punctuation">,</span>key</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> 
            <span class="token comment">// 组件中传回的值也需要分解成row中多个字段的值，用于提交给后台。</span>
            <span class="token comment">// 例如：</span>
            <span class="token comment">// if (row.mobileValue != null) {</span>
            <span class="token comment">//  row.phone = row.mobileValue.phoneNumber</span>
            <span class="token comment">//  row.code = row.mobileValue.callingCode</span>
            <span class="token comment">//  row.country = row.mobileValue.countryCode</span>
            <span class="token comment">// } </span>
            <span class="token comment">// valueResolve 将会在</span>
            <span class="token comment">//   addRequest（解析添加表单的值）</span>
            <span class="token comment">//   updateRequest（解析编辑表单的值）</span>
            <span class="token comment">//   pageRequest（解析查询参数）</span>
            <span class="token comment">// 之前执行</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span>
          dict<span class="token punctuation">:</span> <span class="token punctuation">{</span> <span class="token comment">// 数据字典配置， 供select等组件通过value匹配label</span>
            data<span class="token punctuation">:</span> <span class="token punctuation">[</span> <span class="token comment">// 本地数据字典，若data为null，则通过http请求获取远程数据字典</span>
              <span class="token punctuation">{</span> value<span class="token punctuation">:</span> <span class="token string">'sz'</span><span class="token punctuation">,</span> label<span class="token punctuation">:</span> <span class="token string">'深圳'</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
              <span class="token punctuation">{</span> value<span class="token punctuation">:</span> <span class="token string">'gz'</span><span class="token punctuation">,</span> label<span class="token punctuation">:</span> <span class="token string">'广州'</span> <span class="token punctuation">}</span><span class="token punctuation">,</span> 
              <span class="token punctuation">{</span> value<span class="token punctuation">:</span> <span class="token string">'wh'</span><span class="token punctuation">,</span> label<span class="token punctuation">:</span> <span class="token string">'武汉'</span> <span class="token punctuation">}</span><span class="token punctuation">,</span> 
              <span class="token punctuation">{</span> value<span class="token punctuation">:</span> <span class="token string">'sh'</span><span class="token punctuation">,</span> label<span class="token punctuation">:</span> <span class="token string">'上海'</span> <span class="token punctuation">}</span>
            <span class="token punctuation">]</span><span class="token punctuation">,</span>
            url<span class="token punctuation">:</span><span class="token string">'/dict/get'</span><span class="token punctuation">,</span> 
            <span class="token comment">// url(dict,{form,component}){return '/dict/newUrl'} // 如果url是一个方法，则表示是动态构建url</span>
            cache<span class="token punctuation">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token comment">//是否启用cache，默认开启</span>
            value<span class="token punctuation">:</span><span class="token string">'value'</span><span class="token punctuation">,</span> <span class="token comment">// value的属性名</span>
            label<span class="token punctuation">:</span><span class="token string">'label'</span><span class="token punctuation">,</span> <span class="token comment">// label的属性名</span>
            children<span class="token punctuation">:</span><span class="token string">'children'</span><span class="token punctuation">,</span> <span class="token comment">// children的属性名</span>
            isTree<span class="token punctuation">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">//是否是树形结构</span>
            clone<span class="token punctuation">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">//是否获取到字典数据后clone一份再传递给组件</span>
            <span class="token function-variable function">getData</span><span class="token punctuation">:</span> <span class="token punctuation">(</span><span class="token parameter">url<span class="token punctuation">,</span>dict<span class="token punctuation">,</span><span class="token punctuation">{</span>form<span class="token punctuation">,</span>component<span class="token punctuation">}</span></span><span class="token punctuation">)</span><span class="token operator">=&gt;</span><span class="token punctuation">{</span><span class="token keyword">return</span> Promise<span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token comment">//  覆盖全局getRemoteDictData方法,返回 Promise&lt;[dictData]&gt;</span>
            <span class="token function">getNodes</span><span class="token punctuation">(</span><span class="token parameter">values</span><span class="token punctuation">)</span><span class="token punctuation">{</span><span class="token keyword">return</span> nodeArr<span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token comment">//根据value数组，返回节点数据，用于懒加载时，行展示组件的label显示</span>
            <span class="token function-variable function">transfer</span><span class="token punctuation">:</span><span class="token punctuation">(</span><span class="token parameter">data<span class="token punctuation">,</span>options</span><span class="token punctuation">)</span><span class="token operator">=&gt;</span><span class="token punctuation">{</span><span class="token keyword">return</span> data<span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token comment">// 可以修改获取到的远程数据，比如将字典的id字段转成字符串形式（缓存开启时只会执行一次）</span>
            <span class="token function-variable function">onReady</span><span class="token punctuation">:</span><span class="token punctuation">(</span><span class="token parameter">data<span class="token punctuation">,</span>dict<span class="token punctuation">,</span>options</span><span class="token punctuation">)</span><span class="token operator">=&gt;</span><span class="token punctuation">{</span> <span class="token punctuation">}</span>  <span class="token comment">//每个组件都会执行一次，配置clone=true后可以随便修改字典数据,只会影响自己组件的数据</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span>
          <span class="token comment">//行内单元格显示组件</span>
          component<span class="token punctuation">:</span><span class="token punctuation">{</span>  <span class="token comment">//与form.component类似，更多配置请参考下方form中的component配置</span>
            name<span class="token punctuation">:</span><span class="token string">'dict-select'</span><span class="token punctuation">,</span> 
            <span class="token comment">//如果是非vModel组件，则没有value属性</span>
            <span class="token comment">//此处配置组件的参数名，将row[key]绑定给指定prop</span>
            valueBinding<span class="token punctuation">:</span><span class="token string">'propName'</span><span class="token punctuation">,</span> 
            props<span class="token punctuation">:</span><span class="token punctuation">{</span><span class="token operator">...</span><span class="token punctuation">}</span><span class="token punctuation">,</span>
            style<span class="token punctuation">:</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span>
            <span class="token keyword">class</span><span class="token punctuation">:</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span>
            placeholder<span class="token punctuation">,</span>
            disabled<span class="token punctuation">:</span><span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">//可以传入一个方法</span>
            show<span class="token punctuation">:</span><span class="token boolean">true</span><span class="token punctuation">,</span><span class="token comment">//是否显示单元格组件</span>
            on<span class="token punctuation">:</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token comment">//事件绑定，参考下方form中的on配置</span>
            slots<span class="token punctuation">:</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token comment">//scoped插槽，参考下方form中的slots配置</span>
            children<span class="token punctuation">:</span><span class="token punctuation">[</span><span class="token punctuation">]</span> <span class="token comment">//子元素，参考下方form中的children配置</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span>
          uniqueKey<span class="token punctuation">:</span><span class="token string">''</span><span class="token punctuation">,</span><span class="token comment">//列的唯一id，多级表头动态更新时会导致无法刷新，可以配置它为不同的key，即可解决</span>
          disabled<span class="token punctuation">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">//是否禁止该列（列配置中不显示），不影响form表单</span>
          show<span class="token punctuation">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token comment">//是否在列表中显示该列（列配置中可选），也可以配置一个无参方法</span>
          <span class="token comment">// 是否启用该cell的slot插槽,需要d2-crud-x才支持</span>
          <span class="token comment">// 见 http://preview.d2-crud-plus.docmirror.cn/D2CrudPlusExample/#/demo/form/slot</span>
          rowSlot<span class="token punctuation">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> 
          <span class="token function">formatter</span> <span class="token punctuation">(</span><span class="token parameter">row<span class="token punctuation">,</span> column<span class="token punctuation">,</span> value<span class="token punctuation">,</span> index</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            <span class="token comment">// cell 格式化，http://d2-crud-plus.docmirror.cn/d2-crud-plus/d2-crud-x/columns.html#formatter</span>
          <span class="token punctuation">}</span>
        <span class="token punctuation">}</span>
      
    <span class="token punctuation">]</span>
<span class="token punctuation">}</span>
</code></pre></div><h2 id="form"><a href="#form" class="header-anchor">#</a> form</h2> <div class="language-js extra-class"><pre class="language-js"><code>crudOptions<span class="token punctuation">:</span><span class="token punctuation">{</span>  
    columns<span class="token punctuation">:</span><span class="token punctuation">[</span>
        <span class="token punctuation">{</span>
            form<span class="token punctuation">:</span><span class="token punctuation">{</span>
                title<span class="token punctuation">:</span><span class="token string">'表单字段显示的名称'</span><span class="token punctuation">,</span> <span class="token comment">//默认使用column的title</span>
                rules<span class="token punctuation">:</span> <span class="token punctuation">[</span> <span class="token comment">// 表单校验规则</span>
                    <span class="token comment">//更多帮助请参考 https://element.eleme.cn/#/zh-CN/component/form#zi-ding-yi-xiao-yan-gui-ze</span>
                    <span class="token punctuation">{</span> required<span class="token punctuation">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> message<span class="token punctuation">:</span> <span class="token string">'请选择地区'</span> <span class="token punctuation">}</span>
                <span class="token punctuation">]</span><span class="token punctuation">,</span>
                component<span class="token punctuation">:</span> <span class="token punctuation">{</span> <span class="token comment">//添加和修改时form表单的组件</span>
                  name<span class="token punctuation">:</span> <span class="token string">'dict-select'</span><span class="token punctuation">,</span> <span class="token comment">//表单组件名称，支持任何v-model组件</span>
                  value<span class="token punctuation">:</span> <span class="token keyword">null</span><span class="token punctuation">,</span> <span class="token comment">//组件默认值，你还可以通过覆盖doDialogOpened(context)方法，修改context.form.xx的值</span>
                  props<span class="token punctuation">:</span> <span class="token punctuation">{</span> <span class="token comment">//表单组件的参数，具体参数请查看对应的组件文档</span>
                    <span class="token comment">// 如何查找组件配置，请参考</span>
                    <span class="token comment">// http://d2-crud-plus.docmirror.cn/d2-crud-plus/guide/component.html</span>
                    separator<span class="token punctuation">:</span><span class="token string">&quot;,&quot;</span><span class="token punctuation">,</span><span class="token comment">//dict-select的组件参数，[不同组件参数不同]</span>
                    elProps<span class="token punctuation">:</span><span class="token punctuation">{</span> <span class="token comment">//dict-select内部封装了el-select</span>
                      filterable<span class="token punctuation">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token comment">//可过滤选择项</span>
                      multiple<span class="token punctuation">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token comment">//支持多选</span>
                      clearable<span class="token punctuation">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token comment">//可清除</span>
                    <span class="token punctuation">}</span><span class="token punctuation">,</span>
                    dict<span class="token punctuation">:</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token comment">//详细见dict配置。运行时，会将column.dict复制到此处，再由此处配置的dict覆盖</span>
                  <span class="token punctuation">}</span><span class="token punctuation">,</span>
                  placeholder<span class="token punctuation">:</span><span class="token string">''</span><span class="token punctuation">,</span>
                  disabled<span class="token punctuation">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">//是否在表单中禁用组件，可以配置为方法，动态禁用↓  ↓  ↓  ↓   </span>
                  <span class="token comment">// disabled(context){return false}</span>
                  readonly<span class="token punctuation">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">//表单组件是否是只读，还可以配置为方法，动态只读↓  ↓  ↓  ↓   </span>
                  <span class="token comment">// readonly(context){return false} </span>
                  show<span class="token punctuation">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token comment">//是否显示该字段，还可以配置为方法，动态显隐↓  ↓  ↓  ↓   </span>
                  <span class="token comment">// show(context){return false}       </span>
                  on<span class="token punctuation">:</span><span class="token punctuation">{</span> <span class="token comment">//除input change事件外，更多组件事件监听</span>
                    <span class="token function">select</span><span class="token punctuation">(</span><span class="token parameter">event</span><span class="token punctuation">)</span><span class="token punctuation">{</span>console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span>event<span class="token punctuation">)</span><span class="token punctuation">}</span> <span class="token comment">//监听表单组件的select事件</span>
                  <span class="token punctuation">}</span><span class="token punctuation">,</span>
                  slots<span class="token punctuation">:</span><span class="token punctuation">{</span> <span class="token comment">//插槽渲染</span>
                     <span class="token function-variable function">default</span><span class="token punctuation">:</span><span class="token punctuation">(</span><span class="token parameter">h<span class="token punctuation">,</span>scope</span><span class="token punctuation">)</span><span class="token operator">=&gt;</span><span class="token punctuation">{</span> <span class="token comment">//默认的scoped插槽</span>
                        <span class="token keyword">return</span> <span class="token punctuation">(</span><span class="token operator">&lt;</span>div<span class="token operator">&gt;</span><span class="token punctuation">{</span>scope<span class="token punctuation">.</span>data<span class="token punctuation">}</span><span class="token operator">&lt;</span><span class="token operator">/</span>div<span class="token operator">&gt;</span><span class="token punctuation">)</span>
                     <span class="token punctuation">}</span>
                  <span class="token punctuation">}</span><span class="token punctuation">,</span>
                  children<span class="token punctuation">:</span><span class="token punctuation">[</span> <span class="token comment">//子元素</span>
                      <span class="token punctuation">(</span><span class="token parameter">h</span><span class="token punctuation">)</span><span class="token operator">=&gt;</span><span class="token punctuation">{</span><span class="token keyword">return</span> <span class="token punctuation">(</span><span class="token operator">&lt;</span>div slot<span class="token operator">=</span><span class="token string">&quot;prefix&quot;</span><span class="token operator">&gt;</span>非scoped插槽<span class="token operator">&lt;</span><span class="token operator">/</span>div<span class="token operator">&gt;</span><span class="token punctuation">)</span><span class="token punctuation">}</span>
                  <span class="token punctuation">]</span><span class="token punctuation">,</span>
                  span<span class="token punctuation">:</span> <span class="token number">12</span> <span class="token comment">//该字段占据多宽，24为占满一行</span>
                <span class="token punctuation">}</span><span class="token punctuation">,</span>
                order<span class="token punctuation">:</span><span class="token number">10</span><span class="token punctuation">,</span><span class="token comment">//排序号，默认为10，数字越小 越靠前</span>
                <span class="token comment">//注意：↓↓↓↓ 以下三个disabled，仅初始化时有效，不可动态启用，需要动态显隐字段请配置component.show</span>
                disabled<span class="token punctuation">:</span><span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">//完全关闭该字段在表单中显示</span>
                addDisabled<span class="token punctuation">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">//是否仅在添加编辑框中关闭该字段</span>
                editDisabled<span class="token punctuation">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">//是否仅在修改编辑框中关闭该字段</span>
                <span class="token comment">/**
                   * @param value 当前选择的值
                   * @param form 当前表单
                   * @param getColumn 获取字段配置的方法，getColumn(keyName) 返回keyName的字段配置，可以动态修改组件配置
                   * @param mode 当前模式:【add、edit、search】
                   * @param component 当前组件的ref
                   * @param immediate 是否是对话框打开后立即触发的
                   * @param getComponent 获取组件Ref的方法， getComponent(keyName), 返回组件ref，可以动态调用该组件的方法
                        注意：当component未初始化或者没有显示时，是获取不到组件ref的
                **/</span>
                <span class="token function">valueChange</span><span class="token punctuation">(</span><span class="token parameter">key <span class="token punctuation">,</span>value <span class="token punctuation">,</span>form<span class="token punctuation">,</span> <span class="token punctuation">{</span>getColumn<span class="token punctuation">,</span> mode<span class="token punctuation">,</span> component<span class="token punctuation">,</span> immediate<span class="token punctuation">,</span> getComponent <span class="token punctuation">}</span></span><span class="token punctuation">)</span><span class="token punctuation">{</span>
                    <span class="token comment">// form表单数据change事件，表单值有改动将触发此事件</span>
                <span class="token punctuation">}</span><span class="token punctuation">,</span>
                valueChangeImmediate<span class="token punctuation">:</span><span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">//是否在打开对话框后触发一次valueChange事件</span>
                <span class="token comment">// 是否启用form编辑框的slot插槽,需要d2-crud-x才支持</span>
                <span class="token comment">// 示例 http://preview.d2-crud-plus.docmirror.cn/D2CrudPlusExample/#/demo/form/slot</span>
                slot<span class="token punctuation">:</span><span class="token boolean">false</span><span class="token punctuation">,</span>
                itemProps<span class="token punctuation">:</span><span class="token punctuation">{</span>
                    <span class="token comment">// el-form-item的配置</span>
                    <span class="token comment">//  https://element.eleme.cn/#/zh-CN/component/form#form-item-attributes</span>
                    labelWidth<span class="token punctuation">:</span><span class="token string">'0px'</span> <span class="token comment">//可以隐藏表单项的label</span>
                <span class="token punctuation">}</span> 
            <span class="token punctuation">}</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">]</span>
<span class="token punctuation">}</span>





</code></pre></div></div> <footer class="page-edit"><div class="edit-link"><a href="https://github.com/greper/d2-crud-plus/edit/master//docs/guide/options.md" target="_blank" rel="noopener noreferrer">在 GitHub 上编辑此页</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div> <div class="last-updated"><span class="prefix">上次更新:</span> <span class="time">2021/5/6 上午9:18:35</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
      ←
      <a href="/d2-crud-plus/guide/line-edit.html" class="prev">
        行编辑
      </a></span> <span class="next"><a href="/d2-crud-plus/guide/expose.html">
        暴露的方法
      </a>
      →
    </span></p></div> </main></div><div class="global-ui"></div></div>
    <script src="/d2-crud-plus/assets/js/app.cf559687.js" defer></script><script src="/d2-crud-plus/assets/js/2.40e3d83c.js" defer></script><script src="/d2-crud-plus/assets/js/7.20165752.js" defer></script><script src="/d2-crud-plus/assets/js/91.60784f38.js" defer></script>
  </body>
</html>
